Hello.. |
Re: Use of Object Identifier
Well the obvious way to find an object using the object identifier is to search the object:
string s;
Object o, oResult = null;
for o in entire mod do {
if (isDeleted o || cell o || row o || table o) continue // exclude whatever applicable
s = identifier o
if (s == "TBD_123") { oResult = o; break }
}
string sPrefix = mod."Prefix" // TBD_
string sSearch = "TBD_123"
int absNoToSearch = intOf realOf sSearch[length sPrefix:]
// using object you will get 90% of the objects very quickly in the normal case
Object oResult = object absNoToSearch
// since object only covers visible objects, still do a search if it returns null
if (null oResult) {
Object oSearch;
for oSearch in entire mod do {
if (isDeleted ...) { continue }
int nr = oSearch."Absolute Number"
if (nr == absNoToSearch) { oResult = oSearch; break }
}
}
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|
Re: Use of Object Identifier
That "object(AbsNo)" command puts you at the mercy of the current view; that for me makes it useless.
Skip skpObjects = createString() // KEY: 'string' ObjID: DATA: 'Object' handle
for o in entire mod do
{ if (isDeleted(o)) continue
if (I don't care about o) then continue
put(skpObjects, identifier(o), o)
}
later on ...
if (!find(skpObjects, TargetIdentifier, o)) then error
else
{ deal with target Object o
}
...
delete(skpObjects)
|
Re: Use of Object Identifier llandale - Wed Aug 22 10:06:13 EDT 2012
That "object(AbsNo)" command puts you at the mercy of the current view; that for me makes it useless.
Skip skpObjects = createString() // KEY: 'string' ObjID: DATA: 'Object' handle
for o in entire mod do
{ if (isDeleted(o)) continue
if (I don't care about o) then continue
put(skpObjects, identifier(o), o)
}
later on ...
if (!find(skpObjects, TargetIdentifier, o)) then error
else
{ deal with target Object o
}
...
delete(skpObjects)
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS |
Re: Use of Object Identifier Mathias Mamsch - Thu Aug 23 04:08:04 EDT 2012 Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS You seem to forget I get really carried away! I guess I'll do some timing testing on the "object" function; but still it only works for AbsNo and Identifier searches, not the more general "Key field" searches (such as "Document Number"). -Louie |